package be.ipl.streams.daoimpl;

import java.util.List;

import javax.ejb.Stateless;

import be.ipl.streams.dao.GameDao;
import be.ipl.streams.domaine.Game;

@Stateless
public class GameDaoImpl extends DaoImpl<Game> implements GameDao {
	
	@Override
	public List<Game> listLobby() {
		String queryString = "select g from Games g where g.state = ?1";
		return list(queryString, "LOBBY");
	}
	
	public Game chargerJetons(Game game){
		game = research(game.getId());
		game.getTokens().size();
		return game;
	}

	@Override
	public Game chargerGrids(Game game) {
		game = research(game.getId());
		game.getGrids().size();
		return game;
	}
	
}
